/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.midlet.*;
import   javax.microedition.lcdui.*;
import javax.microedition.lcdui.Displayable;

/**
 * @author etudiant
 */
public class GameMidlet extends MIDlet implements CommandListener {

      private MyGameCanvas gCanvas;
       public GameMidlet(){
          gCanvas= new MyGameCanvas();
       }
    public void commandAction(Command command, Displayable displayable){
        if(displayable == gCanvas)
        {
            if(command == exitCommand)
            {
                notifyDestroyed();
            }
        }
    }
    public static final Command exitCommand = new Command("Echap",Command.EXIT,1);
    public void startApp() {
        Display display = Display.getDisplay(this);
        display.setCurrent(gCanvas);
        gCanvas.addCommand((exitCommand));
        gCanvas.setCommandListener(this);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
